6bf4320dfe8d707f34b818606685cbe85e84a8bc,algoliasearch/src/test/java/com/algolia/search/saas/IndexTest.java,IndexTest,testGetObjectWithAttributesToRetrieveAsync,#,416
Before Change
public void testGetObjectWithAttributesToRetrieveAsync() throws Exception {
List<String> attributesToRetrieve = new ArrayList<String>();
attributesToRetrieve.add("objectID");
AssertCompletionHandler handler = new AssertCompletionHandler() {
@Override public void doRequestCompleted(JSONObject content, AlgoliaException error) {
if (error == null) {
assertTrue("Object has unexpected objectId", content.optString("objectID").equals(ids.get(0)));
assertFalse("Object has unexpected 'city' attribute", content.has("city"));
} else {
fail(error.getMessage());
}
}
};
index.getObjectAsync(ids.get(0), attributesToRetrieve, handler);
handler.checkAssertions();
}
After Change
public void testGetObjectWithAttributesToRetrieveAsync() throws Exception {
List<String> attributesToRetrieve = new ArrayList<String>();
attributesToRetrieve.add("objectID");
index.getObjectAsync(ids.get(0), attributesToRetrieve, new AssertCompletionHandler() {
@Override public void doRequestCompleted(JSONObject content, AlgoliaException error) {
if (error == null) {
assertTrue("Object has unexpected objectId", content.optString("objectID").equals(ids.get(0)));
assertFalse("Object has unexpected 'city' attribute", content.has("city"));
} else {
fail(error.getMessage());
}
}
});
}
@Test